package com.nuc.bigdata.feign;

import com.nuc.bigdata.feign.entity.NewsFeign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.ArrayList;

/**
 * 调用oa-news服务的feign客户端
 * @author JackLuo
 * @date 2019/11/18
 */
@FeignClient(name = "oa-news")
public interface NewsServiceFeign {

    /**
     * 查询所有的新闻feign
     * @return 包含新闻feign的ArrayList
     */
    @GetMapping("/oa-news")
    ArrayList<NewsFeign> listNews();

    /**
     * 查询指定新闻的新闻信息
     * @param newsId 新闻唯一标识
     * @return 新闻feign类
     */
    @GetMapping("/oa-news/{newsId}")
    NewsFeign getNews(@PathVariable("newsId")String newsId);
}
